<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="__PUBLIC__/dist/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/dist/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/dist/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/dist/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/dist/css/style.min862f.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>门店分类列表</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            <div class="col-sm-7 m-b-xs hide">
                                <a href="{:Url('GoodsStore/info')}" class="btn btn-primary">增加</a>
                            </div>

                            <div class="col-sm-5">
                                <form method="get">
                                    <div class="input-group">
                                        <input type="text" placeholder="请输入分类名称关键词" name="keyword" value="{:input('param.keyword')}"
                                            class="form-control">
                                        <span class="input-group-btn">
                                            <button type="button" class="btn btn-primary" onclick="ajax_index();"> 搜索</button>
                                        </span>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div id="ajax_index_box">

                        </div>
                    </div>

                    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                        aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                        &times;
                                    </button>
                                    <h4 class="modal-title" id="myModalLabel">
                                        设置库存
                                    </h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">
                                                变更数量：
                                                <p style="color:red;" id="old_store_count">
                                                    (目前库存：0)
                                                </p>
                                            </label>
                                            <div class="col-sm-8">
                                                <input type="text" id="new_store_count" name="new_store_count" class="form-control"
                                                    value="0">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <input type="hidden" id="goods_store_id" value="0">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                                    </button>
                                    <button type="button" data-state="1" class="btn btn-primary set_store_count_btn">
                                        添加库存
                                    </button>
                                    <button type="button" data-state="0" class="btn btn-primary set_store_count_btn">
                                        减少库存
                                    </button>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal -->
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="__PUBLIC__/dist/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/dist/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__PUBLIC__/dist/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="__PUBLIC__/dist/js/content.min.js?v=1.0.0"></script>
    <script src="__PUBLIC__/dist/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__PUBLIC__/dist/js/demo/peity-demo.min.js"></script>
    <script src="__PUBLIC__/dist/js/plugins/layer/layer.min.js"></script>
    <script>
        $(document).ready(function () { $(".i-checks").iCheck({ checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green", }) });

        function ajax_index(p) {
            $.ajax({
                url: "{:Url('GoodsStore/index')}",
                data: { p: p, keyword: $('input[name=keyword]').val() },
                type: "get",
                success: function (html) {
                    $('#ajax_index_box').html(html);
                }
            });
        }
        ajax_index();

        $('.set_store_count_btn').click(function () {
            var state = $(this).attr('data-state');
            var id = $('#goods_store_id').val();
            var new_store_count = $('#new_store_count').val();
            if (id > 0 && new_store_count > 0) {
                $.ajax({
                    url: "{:Url('GoodsStore/set_store_count')}",
                    data: { id: id, store_count: new_store_count, state: state },
                    type: "get",
                    success: function (data) {
                        if (data == 1) {
                            window.location = "{:Url('GoodsStore/index')}";
                        } else {
                            alert('设置库存失败');
                        }
                    }
                });
            } else {
                alert('变更库存数量不能少于1');
            }
        });
    </script>

</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->

</html>